const HtmlWebpackPlugin = require("html-webpack-plugin");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const {CleanWebpackPlugin} = require("clean-webpack-plugin");


module.exports = {
    entry:"./src/main.js",
    // devServer: {  
    //     hot: false, //没起作用
    // },
    module:{
        rules:[
            {
                test: /\.vue$/,
                loader: "vue-loader"
            },
            {
                test: /\.css$/,
                use: [MiniCssExtractPlugin.loader,"css-loader"]
            },
            {
                test: /\.less$/,
                use: [MiniCssExtractPlugin.loader,"css-loader","less-loader"]
            }
        ]
    },
    plugins: [
        new HtmlWebpackPlugin({
            title: "vue.js",
            template: "./src/index.html"
        }),
        new CleanWebpackPlugin(), // 对vue.pro.config.js不起作用
        new VueLoaderPlugin(),
        new MiniCssExtractPlugin({
            filename: "style.css"
        })
        
        
        
    ]
}